package com.wzxy.nc.util;

import com.opensymphony.xwork2.ActionContext;
import com.wzxy.nc.entity.SysUser;

public class HttpSessionUtil{
	
	/**
	 * 取到session中键值为key的对象，返回T
	 * @param key
	 * @param t
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public static <T> T getObject(String key,T t){
		return (T)ActionContext.getContext().getSession().get(key);
	}
	
	public static void put(String key,Object value){
		ActionContext.getContext().getSession().put(key, value);
	}
	
	public static SysUser getCurrentUser(){
		return (SysUser) ActionContext.getContext().getSession().get(SysConstant.LOGIN_USER);
	}
	
}
